package org.anq.ddm.service;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import org.anq.ddm.mapper.BpmnProcessMapper;
import org.anq.ddm.mapper.FormMapper;
import org.anq.ddm.pojo.BpmnProcess;
import org.anq.ddm.pojo.Form;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class FormService extends ServiceImpl<FormMapper, Form> {

    @Autowired
    FormMapper formMapper;

    public Form findByFromKey(String formname) {
        QueryWrapper<Form> qw = new QueryWrapper();
        if (formname != null) {
            qw.eq("formname", formname);
        }
        Form d = this.formMapper.selectOne(qw);
        return d;
    }

    public List<Form> findByStatus(Integer status) {
        QueryWrapper<Form> qw = new QueryWrapper();
        if (status != null) {
            qw.eq("status", status);
        }
        return this.formMapper.selectList(qw);
    }

}
